﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kooboo.CMS.SiteConverter.Parser;

namespace Kooboo.CMS.SiteConverter
{
    public class ParserSetting
    {
        public const ParserType DefaultParserType = ParserType.Razor;

        public const string ControlType_Date = "Date";
        public const string ControlType_File = "File";
        public const string ControlType_Textbox = "TextBox";
        public const string ControlType_Textarea = "TextArea";
        public const string ControlType_Tinymce = "Tinymce";

        private static bool _removeFuncMarkers = true;
        public static bool RemoveFuncMarkers
        {
            get { return _removeFuncMarkers; }
            set { _removeFuncMarkers = value; }
        }

        private static string _siteTemplatePath;
        public static string SiteTemplatePath
        {
            get { return _siteTemplatePath; }
            set
            {
                if (!System.IO.File.Exists(value))
                    throw new Exception("Can not find the site template zip file.");
                _siteTemplatePath = value;
            }
        }

        private static string _resDirectoryPath;
        public static string ResDirectoryPath
        {
            get { return _resDirectoryPath; }
            set
            {
                if (!System.IO.File.Exists(value))
                    throw new Exception("Can not find the resource mapping file.");
                _resDirectoryPath = value;
            }
        }

        private static string _defaultControlType = "TextBox";
        public static string DefaultControlType
        {
            get { return _defaultControlType; }
            set { _defaultControlType = value; }
        }

        private static int _defaultPageSize = 5;
        public static int DefaultPageSize
        {
            get { return _defaultPageSize; }
            set
            {
                if (value < 1)
                    throw new Exception("Page size can not less then 1.");
                _defaultPageSize = value;
            }
        }

        private static int _defaultTakeTop = 100;
        public static int DefaultTakeTop
        {
            get { return _defaultTakeTop; }
            set
            {
                if (value < 1)
                    throw new Exception("Take top can not less then 1.");
                _defaultTakeTop = value;
            }
        }

        private static int _defaultTextContentCount = 5;
        public static int DefaultTextContentCount
        {
            get { return _defaultTextContentCount; }
            set
            {
                if (value < 1)
                    throw new Exception("Content count can not less then 1.");
                _defaultTextContentCount = value;
            }
        }
    }
}
